package com.xauto.pioneer.appuser.model;

import org.json.JSONObject;

/**
 * 会员账户信息对象
 * Created by Lemon on 22/04/2017.
 */
public class MemberAccount extends BaseModel<MemberAccount> {

    /** 累计消费金额*/
    public String total_consume_amount;
    /** 账户余额*/
    public String balance_amount;
    /** 等级信用金额*/
    public String member_level_credit_amount;
    /** 信用金额*/
    public String deposit_amount;
    /** 可使用信用金额（deposit_amount+balance_amount)*/
    public String total_credit_amount;
    /** 预警金额 (total_credit_amount * tb_setting.creadit_warning_percent)*/
    public String credit_warning_amount;

    @Override
    public MemberAccount parse(JSONObject jsonObject) {
        if(jsonObject != null) {
            total_consume_amount = jsonObject.optString("total_consume_amount");
            balance_amount = jsonObject.optString("balance_amount");
            member_level_credit_amount = jsonObject.optString("member_level_credit_amount");
            total_credit_amount = jsonObject.optString("total_credit_amount");
            deposit_amount = jsonObject.optString("deposit_amount");
            credit_warning_amount = jsonObject.optString("credit_warning_amount");
            return this;
        }
        return null;
    }
}
